package cn.thornbird.orgsync.repository;

import cn.thornbird.orgsync.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface UserRepository extends BaseRepository<User>, JpaRepository<User, String>,
        JpaSpecificationExecutor<User> {

    Long countByActive(Boolean active);

    User findFirstByUsernameIgnoreCase(String username);

    User findFirstByEmailIgnoreCase(String email);

    User findFirstByMobile(String mobile);

    User findFirstBySuperuserIsTrue();

    List<User> findByIdIn(List<String> ids);

}
